import 'package:flutter/material.dart';

void main() {
  runApp(const MaterialApp(home: Main()));
}

class Main extends StatefulWidget {
  const Main({super.key});

  @override
  _MainState createState() => _MainState();
}

class _MainState extends State<Main> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          'ListView - 1,基础用法',
          style: TextStyle(color: Colors.white),
        ),
        backgroundColor: Colors.deepPurpleAccent,
      ),
      body: Container(
        color: Colors.transparent,
        child: ListView(
          reverse: true,
          children: [
            Container(
              height: 100,
              color: Colors.amber,
              child: const Text('元素1'),
            ),
            Container(
              height: 200,
              color: Colors.deepOrangeAccent,
              child: const Text('元素2'),
            ),
            Container(
              height: 300,
              color: Colors.brown,
              child: const Text('元素3'),
            ),
            Container(
              height: 400,
              color: Colors.cyan,
              child: const Text('元素4'),
            ),
            Container(
              height: 500,
              color: const Color.fromARGB(255, 173, 11, 227),
              child: const Text('元素5'),
            ),
          ],
        ),
      ),
    );
  }
}
